﻿using System;
using System.Collections.Generic;
using System.Text;

namespace XEAS.Engine.Business
{
    internal sealed class Sql
    {
        internal sealed class SYS_Plugin
        {
            internal const string Add =
                @"INSERT INTO SYS_Plugin(ID, PluginID, Name, Description, Author, Version, Website, PublishDate, LogoFileUrl) VALUES(@ID, @PluginID, @Name, @Description, @Author, @Version, @Website, @PublishDate, @LogoFileUrl)";

            internal const string Edit =
                @"UPDATE SYS_Plugin SET Name=@Name, Description=@Description, Author=@Author, Version=@Version, PublishDate=@PublishDate, LogoFileUrl=@LogoFileUrl WHERE ID=@ID";

            internal const string Delete = @"DELETE FROM SYS_Plugin WHERE ID=@ID";

            internal const string ListAll = @"SELECT * FROM SYS_Plugin";

            internal const string ViewDetailsByName = @"SELECT * FROM SYS_Plugin WHERE Name=@Name";

            internal const string ViewDetailsByID = @"SELECT * FROM SYS_Plugin WHERE ID=@ID";

            internal const string ViewDetailsByPluginID = @"SELECT * FROM SYS_Plugin WHERE PluginID=@PluginID";

            internal const string IsExist = @"SELECT COUNT(ID) FROM SYS_Plugin WHERE PluginID=@PluginID AND Name=@Name";
        }
    }
}
